/**
 * 
 */
package com.xb.cloud.product.merchant.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.xb.cloud.product.merchant.inner.service.ProductSkuExtPicInnerService;
import com.xb.cloud.product.merchant.service.client.ProductSkuExtPicService;
import com.xb.cloud.product.merchant.service.client.bo.EndMerchantUserBo;
import com.xb.cloud.product.merchant.service.client.input.bo.ProductSkuPicInputBo;
import com.xb.cloud.service.client.ServiceReturnCodes;
import com.xb.cloud.service.client.ServiceReturnInfo;
import com.xb.cloud.service.client.ServiceReturnUtils;

/**
 * sku扩展图片服务类
 * 
 * @author kexue
 *
 */
@Service
public class ProductSkuExtPicServiceImpl extends AbstractService implements ProductSkuExtPicService {

	private static final Logger LOGGER = LoggerFactory.getLogger(ProductPublishServiceImpl.class);

	@Resource
	private ProductSkuExtPicInnerService productSkuExtPicInnerService;
	

	/**
	 * 插入sku扩展图片
	 * @param skuPics
	 * 
	 */
	@Override
	public ServiceReturnInfo createSkuExtPics(List<ProductSkuPicInputBo> skuPics, Long productSkuId,
			EndMerchantUserBo endMerchantUserBo) {
		int rows = productSkuExtPicInnerService.createSkuExtPics(skuPics, productSkuId, endMerchantUserBo);
		if(rows>0){
			return ServiceReturnUtils.success(rows);
		}else{
			return ServiceReturnUtils.error(ServiceReturnCodes.SYSTEM_EXCEPTION);
		} 
	}
}
